var app = new Vue({
	el:"#app",
	data:{
		city:["北京","上海","广州","郑州"],
		curName:"",
		fore:[]
	},
	methods:{
		searchWeather:function(){
			var that = this;
			console.log(that.curName + "查询天气!!!"); 
			axios.get("http://wthrcdn.etouch.cn/weather_mini?city="+ this.curName).then(function(response){
				var forecast = response.data.data.forecast;
				that.fore = forecast;
				// 这样获取值总是延后一个
				// for(var i = 0; i < forecast.length;i++){
					// that.fore[i] = forecast[i];
				// }
			}).catch(function(err){
				console.log(err);
			});
		},
		clickSearch:function(item){
			this.curName = item;
			this.searchWeather();
		}
	}
})